package com.ds.infrastructure.audit.collector.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.ds.infrastructure.audit.common.validator.Save;
import com.ds.infrastructure.audit.common.validator.Update;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Positive;
import java.io.Serializable;
import java.util.Date;

/**
 * 作用：
 *
 * @author WeiShaoying
 * @date 2020/7/30
 */
@Data
@Accessors(chain = true)
@TableName(resultMap = "BaseResultMap")
@ToString()
public class App implements Serializable {

    private static final long serialVersionUID = 1764117261497977754L;

    @Null(message = "id必须为空", groups = {Save.class})
    @NotNull(message = "id不能为空", groups = {Update.class})
    @Positive(message = "id必须大于0", groups = {Update.class})
    private Long id;


    @NotBlank(message = "appName不能为空", groups = {Save.class})
    @Null(message = "appName不能更新", groups = {Update.class})
    private String appName;

    /**
     * app key
     */
    @Null(message = "appKey不能更新", groups = {Update.class})
    private String appKey;

    @NotBlank(message = "owner不能为空", groups = {Save.class})
    private String owner;


    private Date createTime;

    private Date modifyTime;

    /**
     * 状态 0停用、1启用、2限制
     */
    private Integer status;

    /**
     * 限速
     */
    private Long speedLimit;

    /**
     *
     */
    private Long totalLimit;


    /**
     * 是否删除标识： 0未删除 1已删除
     */
    private Integer isDel;

    /**
     *
     */
    private String remark;

}
